3.4.7 \(\int \frac {\cos (x)}{a+b \sin ^2(x)} \, dx\) [307]

Optimal. Leaf size=25 \[ \frac {\tan ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {b}} \]

[Out]

arctan(sin(x)*b^(1/2)/a^(1/2))/a^(1/2)/b^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3269, 211} \begin {gather*} \frac {\text {ArcTan}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {b}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[x]/(a + b*Sin[x]^2),x]

[Out]

ArcTan[(Sqrt[b]*Sin[x])/Sqrt[a]]/(Sqrt[a]*Sqrt[b])

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 3269

Int[cos[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b*ff^2*x^2)^p, x], x, Sin[e +
f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \frac {\cos (x)}{a+b \sin ^2(x)} \, dx &=\text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\sin (x)\right )\\ &=\frac {\tan ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {b}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 25, normalized size = 1.00 \begin {gather*} \frac {\tan ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {b}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]/(a + b*Sin[x]^2),x]

[Out]

ArcTan[(Sqrt[b]*Sin[x])/Sqrt[a]]/(Sqrt[a]*Sqrt[b])

________________________________________________________________________________________

Maple [A]
time = 0.11, size = 17, normalized size = 0.68

method result size
derivativedivides \(\frac {\arctan \left (\frac {b \sin \left (x \right )}{\sqrt {a b}}\right )}{\sqrt {a b}}\) \(17\)
default \(\frac {\arctan \left (\frac {b \sin \left (x \right )}{\sqrt {a b}}\right )}{\sqrt {a b}}\) \(17\)
risch \(-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right )}{2 \sqrt {-a b}}+\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right )}{2 \sqrt {-a b}}\) \(64\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/(a+b*sin(x)^2),x,method=_RETURNVERBOSE)

[Out]

1/(a*b)^(1/2)*arctan(b*sin(x)/(a*b)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.47, size = 16, normalized size = 0.64 \begin {gather*} \frac {\arctan \left (\frac {b \sin \left (x\right )}{\sqrt {a b}}\right )}{\sqrt {a b}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(a+b*sin(x)^2),x, algorithm="maxima")

[Out]

arctan(b*sin(x)/sqrt(a*b))/sqrt(a*b)

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 78, normalized size = 3.12 \begin {gather*} \left [-\frac {\sqrt {-a b} \log \left (-\frac {b \cos \left (x\right )^{2} + 2 \, \sqrt {-a b} \sin \left (x\right ) + a - b}{b \cos \left (x\right )^{2} - a - b}\right )}{2 \, a b}, \frac {\sqrt {a b} \arctan \left (\frac {\sqrt {a b} \sin \left (x\right )}{a}\right )}{a b}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(a+b*sin(x)^2),x, algorithm="fricas")

[Out]

[-1/2*sqrt(-a*b)*log(-(b*cos(x)^2 + 2*sqrt(-a*b)*sin(x) + a - b)/(b*cos(x)^2 - a - b))/(a*b), sqrt(a*b)*arctan
(sqrt(a*b)*sin(x)/a)/(a*b)]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 66 vs. \(2 (24) = 48\).
time = 0.41, size = 66, normalized size = 2.64 \begin {gather*} \begin {cases} \frac {\tilde {\infty }}{\sin {\left (x \right )}} & \text {for}\: a = 0 \wedge b = 0 \\\frac {\sin {\left (x \right )}}{a} & \text {for}\: b = 0 \\- \frac {1}{b \sin {\left (x \right )}} & \text {for}\: a = 0 \\\frac {\log {\left (- \sqrt {- \frac {a}{b}} + \sin {\left (x \right )} \right )}}{2 b \sqrt {- \frac {a}{b}}} - \frac {\log {\left (\sqrt {- \frac {a}{b}} + \sin {\left (x \right )} \right )}}{2 b \sqrt {- \frac {a}{b}}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(a+b*sin(x)**2),x)

[Out]

Piecewise((zoo/sin(x), Eq(a, 0) & Eq(b, 0)), (sin(x)/a, Eq(b, 0)), (-1/(b*sin(x)), Eq(a, 0)), (log(-sqrt(-a/b)
 + sin(x))/(2*b*sqrt(-a/b)) - log(sqrt(-a/b) + sin(x))/(2*b*sqrt(-a/b)), True))

________________________________________________________________________________________

Giac [A]
time = 0.44, size = 16, normalized size = 0.64 \begin {gather*} \frac {\arctan \left (\frac {b \sin \left (x\right )}{\sqrt {a b}}\right )}{\sqrt {a b}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(a+b*sin(x)^2),x, algorithm="giac")

[Out]

arctan(b*sin(x)/sqrt(a*b))/sqrt(a*b)

________________________________________________________________________________________

Mupad [B]
time = 14.64, size = 17, normalized size = 0.68 \begin {gather*} \frac {\mathrm {atan}\left (\frac {\sqrt {b}\,\sin \left (x\right )}{\sqrt {a}}\right )}{\sqrt {a}\,\sqrt {b}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/(a + b*sin(x)^2),x)

[Out]

atan((b^(1/2)*sin(x))/a^(1/2))/(a^(1/2)*b^(1/2))

________________________________________________________________________________________